{extends file="main.tpl"}
{block name=head}
<script>
  	$(document).ready(function(){	
  	$.ajax({
	    url:'itemQtyAjax.php',
	    data:{ tableId: {$tableVar}, itemId: 9, tablePart: '{$tablePartVar}',  waiterId: {$waiterVar}},
	    dataType:'HTML',
	    type:'POST',
	      
	    success:function(msg){
       	$('#itemQty_9').val(msg);
	    }
    });
    $.ajax({
	    url:'itemQtyAjax.php',
	    data:{ tableId: {$tableVar}, itemId: 8, tablePart: '{$tablePartVar}',  waiterId: {$waiterVar}},
	    dataType:'HTML',
	    type:'POST',
	      
	    success:function(msg){
       	$('#itemQty_8').val(msg);
	    }
    });

	
    $('#plus8').mousedown(function(){
      var quantity=$('#itemQty_8').val();
 	    $('#itemQty_8').val(parseInt(quantity) + 1 );
 	    $.ajax({
        url:'itemAjax.php',
        data:{ waiterId: {$waiterVar}, tableId: {$tableVar}, quantity: $('#itemQty_8').val(), itemId: 8, tablePart: '{$tablePartVar}' },
        dataType:'HTML',
        type:'POST',
        success:function(msg){
        }
      });
    });
    $('#minus8').mousedown(function(){
 	    var quantity=$('#itemQty_8').val();
 	  	if(quantity > 0)
 	  	{
 	  	  $('#itemQty_8').val(parseInt(quantity) - 1 );
 	      $.ajax({
          url:'itemAjax.php',
          data:{ waiterId: {$waiterVar}, tableId: {$tableVar}, quantity: $('#itemQty_8').val(), itemId: 8, tablePart: '{$tablePartVar}' },
          dataType:'HTML',
          type:'POST',
          success:function(msg){}
        });
      }
    });
    $('#plus9').mousedown(function(){
      var quantity=$('#itemQty_9').val();
 	    $('#itemQty_9').val(parseInt(quantity) + 1 );
 	    $.ajax({
        url:'itemAjax.php',
        data:{ waiterId: {$waiterVar}, tableId: {$tableVar}, quantity: $('#itemQty_9').val(), itemId: 9, tablePart: '{$tablePartVar}' },
        dataType:'HTML',
        type:'POST',
          
        success:function(msg){}
      });
    });
    $('#minus9').mousedown(function(){
 	    var quantity=$('#itemQty_9').val();
 	  	if(quantity > 0)
 	  	{
 	  	  $('#itemQty_9').val(parseInt(quantity) - 1 );
 	      $.ajax({
          url:'itemAjax.php',
          data:{ waiterId: {$waiterVar}, tableId: {$tableVar}, quantity: $('#itemQty_9').val(), itemId: 9, tablePart: '{$tablePartVar}' },
          dataType:'HTML',
          type:'POST',
          
          success:function(msg){}
        });
      }
    });
    
});
</script>
{/block}
{block name=body}
   <table>
     <tr>
       {if $tableVar > 0 && $waiterVar > 0}
       <a href="window8.php?table={$tableVar}&waiter={$waiterVar}&tablePart={$tablePartVar}">get order</a>
       {/if}
     </tr>
   	 <tr>
   	   <td rowspan="2" valign="top">
   	     <table id="tableNo" clsss="waiterdiv" cellpadding="8" border="1">
         	 <tr>
             <th colspan="5">Table No &nbsp&nbsp&nbsp&nbsp
               <a href="index.php?waiter={$waiterVar}&table={$tableVar}&tablePart=A">{if $tablePartVar=='A'}<font color="green">A</font>{else}A{/if}</a>&nbsp;
               <a href="index.php?waiter={$waiterVar}&table={$tableVar}&tablePart=B">{if $tablePartVar=='B'}<font color="green">B</font>{else}B{/if}</a>
             </th>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=1&tablePart={$tablePartVar}" id="1">1</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=2&tablePart={$tablePartVar}" id="2">2</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=3&tablePart={$tablePartVar}" id="3">3</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=4&tablePart={$tablePartVar}" id="4">4</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=5&tablePart={$tablePartVar}" id="5">5</a></td>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=6&tablePart={$tablePartVar}" id="6">6</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=7&tablePart={$tablePartVar}" id="7">7</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=8&tablePart={$tablePartVar}" id="8">8</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=9&tablePart={$tablePartVar}" id="9">9</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=10&tablePart={$tablePartVar}" id="10">10</a></td>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=11&tablePart={$tablePartVar}" id="11">11</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=12&tablePart={$tablePartVar}" id="12">12</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=13&tablePart={$tablePartVar}" id="13">13</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=14&tablePart={$tablePartVar}" id="14">14</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=15&tablePart={$tablePartVar}" id="15">15</a></td>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=16&tablePart={$tablePartVar}" id="16">16</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=17&tablePart={$tablePartVar}" id="17">17</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=18&tablePart={$tablePartVar}" id="18">18</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=19&tablePart={$tablePartVar}" id="19">19</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=20&tablePart={$tablePartVar}" id="20">20</a></td>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=21&tablePart={$tablePartVar}" id="21">21</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=22&tablePart={$tablePartVar}" id="22">22</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=23&tablePart={$tablePartVar}" id="23">23</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=24&tablePart={$tablePartVar}" id="24">24</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=25&tablePart={$tablePartVar}" id="25">25</a></td>
           </tr>
           <tr>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=26&tablePart={$tablePartVar}" id="26">26</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=27&tablePart={$tablePartVar}" id="27">27</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=28&tablePart={$tablePartVar}" id="28">28</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=29&tablePart={$tablePartVar}" id="29">29</a></td>
             <td align="center"><a href="index.php?waiter={$waiterVar}&table=30&tablePart={$tablePartVar}" id="30">30</a></td>
           </tr>
         </table>
         <br /><br /><br />
         <table>
           <tr>
             <td align="center"><a href=""><font size="4">Juice</font></a></td>
               <td>&nbsp&nbsp</td>
               <td align="center"><a href=""><font size="4">Faluda</font></a></td>
           </tr>
           <tr>
             <td>&nbsp&nbsp<img src="./images/fruitJuice.jpg" height="100px" width="100px"></td>
             <td>&nbsp&nbsp</td>
             <td><img src="./images/faluda1.jpg" height="100px" width="100px"></td>
           </tr>
           <tr>
             <td clsss="amount">
               {if $tableVar > 0 && $waiterVar > 0}
                 <button id="plus8">+</button>
                 <input  type="text" name="itemQty_8" value="0" style="width:40px;" class="itemQty_7" id="itemQty_8" />
                 <button id="minus8">-</button>
               {/if}
             </td>
             <td>&nbsp;&nbsp;</td>
             <td>
               {if $tableVar > 0 && $waiterVar > 0}
                 <button id="plus9">+</button>
                 <input  type="text" name="itemQty_9" value="0" style="width:40px;" class="faluda" id="itemQty_9" />
                 <button id="minus9" class="sum">-</button>
               {/if}
             </td>
           </tr>
           <tr>
             <td colspan="3" align="center">
               <a href="index.php?waiter={$waiterVar}&table=1001&tablePart={$tablePartVar}" >
               	<img src="./images/car.jpg" height="90px" width="150px"/><br />
             	  &nbsp;&nbsp;&nbsp;<font size="4">Car</font></a>
             </td>
           </tr>
         </table>
         <br />
         
   	   </td>
   	   <td align="center">
   	     <table id="waiter" border="1" cellpadding="10" >
           <tr>
             <th colspan="4">Waiter</th>
           </tr>
           <tr>
             <td><a href="index.php?waiter=1&table={$tableVar}&tablePart={$tablePartVar}">A</a></td>
             <td><a href="index.php?waiter=2&table={$tableVar}&tablePart={$tablePartVar}">B</a></td>
             <td><a href="index.php?waiter=3&table={$tableVar}&tablePart={$tablePartVar}">C</a></td>
             <td><a href="index.php?waiter=4&table={$tableVar}&tablePart={$tablePartVar}">D</a></td>
           </tr>
           <tr>
             <td><a href="index.php?waiter=5&table={$tableVar}&tablePart={$tablePartVar}">E</a></td>
             <td><a href="index.php?waiter=6&table={$tableVar}&tablePart={$tablePartVar}">F</a></td>
             <td><a href="index.php?waiter=7&table={$tableVar}&tablePart={$tablePartVar}">G</a></td>
             <td><a href="index.php?waiter=8&table={$tableVar}&tablePart={$tablePartVar}">H</a></td>
           </tr>
           <tr>
             <td><a href="index.php?waiter=9&table= {$tableVar}&tablePart={$tablePartVar}">I</a></td>
             <td><a href="index.php?waiter=10&table={$tableVar}&tablePart={$tablePartVar}">J</a></td>
             <td><a href="index.php?waiter=11&table={$tableVar}&tablePart={$tablePartVar}">K</a></td>
             <td><a href="index.php?waiter=12&table={$tableVar}&tablePart={$tablePartVar}">L</a></td>
           </tr>
         </table>	
   	   </td>
   	   <td valign="top">
   	     <table border="1" cellpadding="6" style="font-size:15px;">
   	 	   	 <tr>
   	 	   	 	 <iframe src="currentTables.php?waiter={$waiterVar}&table={$tableVar}&orderId={$orderId}" width="700" height="350"></iframe>
   	 	   	 </tr>
         </table>
   	   </td>
   	 </tr>
   	 <tr>
   	   <td>
   	     <table cellpadding="10" align="center" border="0">
          	<tr>
          	  <td colspan="2" align="center">
          	  	<a href="iceCream.php?waiter={$waiterVar}&table={$tableVar}&tablePart={$tablePartVar}">
          	  	  <img src="./images/a.jpg" height="100px" width="100px">&nbsp;&nbsp;
          	      <br/><br/>
          	      <font size="4">Ice-Cream </font>
          	    </a>
          	  </td>
          	  <td align="center">
          	  	<a href="shake.php?waiter={$waiterVar}&table={$tableVar}&tablePart={$tablePartVar}">
          	  		<img src="./images/shake.jpg" height="100px" width="100px">&nbsp;&nbsp;
          	      <br/><br/><font size="4">Shake</font>
          	    </a>  
          	  </td>
          	</tr>
          	<tr>
          	  <td align="center">
          	  	<a href="chinese.php?waiter={$waiterVar}&table={$tableVar}&tablePart={$tablePartVar}&tablePart={$tablePartVar}">
          	  	  <img src="./images/chinese.jpg" height="100px" width="100px">&nbsp;&nbsp;
          	      <br/><br/><font size="4">Chinese</font>
          	    </a>
          	  </td>
          	  <td align="center">
          	  	<a href="pizzas.php?waiter={$waiterVar}&table={$tableVar}&tablePart={$tablePartVar}">
          	  		<img src="./images/pizzas.jpg" height="100px" width="100px">&nbsp;&nbsp;
          	      <br/><br/><font size="4">Pizzas</font>
          	    </a>
          	  </td>
          	  <td align="center">
          	    <a href="sandwiches.php?waiter={$waiterVar}&table={$tableVar}&tablePart={$tablePartVar}">
          	    	<img src="./images/sandwiches.jpg" height="100px" width="100px">
          	      <br/><br/><font size="4">Sandwiches</font>
          	    </a>
          	  </td>
            </tr>
         </table>
   	   </td>
   	   <td> 
   	     <table align="center" border="1" cellpadding="6" style="font-size:15px;">
           <tr>
           	 <iframe id="selectedTableIframe" src="selectedTable.php?waiterId={$waiterVar}&tableId={$tableVar}&tablePart={$tablePartVar}" width="450" height="500"></iframe>
           </tr>
         </table>
   	   </td>
   	 </tr>
   </table>
{/block}